package y23.Sep;

import java.util.Arrays;

public class Test11 {
    public static void main(String[] args) {
        Solution4 solution4 = new Solution4();
        String s1 = "abc" ,s2 = "bca";
        System.out.println(solution4.CheckPermutation(s1,s2));
        s1 = "abc";
        s2 = "bad";
        System.out.println(solution4.CheckPermutation(s1,s2));
    }
}

class Solution4{
    public boolean CheckPermutation(String s1, String s2) {
        if (s1.length() != s2.length()) {
            return false;
        }
        char[] str1 = s1.toCharArray();
        char[] str2 = s2.toCharArray();
        Arrays.sort(str1);
        Arrays.sort(str2);
        return Arrays.equals(str1, str2);
    }
}
